package com.springboot.demo.entity;

import com.springboot.demo.entity.validate.user.IdGroup;
import com.springboot.demo.entity.validate.user.UsernameGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author wubc683
 * @desc
 * @date 2021-07-27 9:05
 */
@Data
public class CentralMonitor {
    @ApiModelProperty(value = "集中监控分组id",required = true)
    @NotNull(message = "集中监控分组id不能为null",groups = IdGroup.class)
    private Long id;
    @ApiModelProperty(value = "集中监控分组名称",required = true)
    @NotEmpty(message = "集中监控分组名称不能为null或者空")
    @Length(max=16,message = "集中监控分组名称长度超过限制值")
    @Pattern(regexp = "^[\\u4E00-\\u9FA5a-zA-Z0-9_-]{6,32}$", message = "集中监控分组名格式错误")
    private String name;
    @ApiModelProperty(value = "集中监控所属用户id",required = true)
    @NotNull(message = "集中监控所属用户id不能为null")
    private Long ownerId;
}
